#include "TcpServer.hpp"

void Usage(const std::string& s)
{
    std::cerr << "Usage: " << s << " port" << std::endl;
}

int main(int argc, char* argv[])
{
    if(argc != 2)
    {
        Usage(argv[0]);
        exit((int)exit_code::USAGE_ERR);
    }

    uint16_t port = std::stoi(argv[1]);

    std::unique_ptr<TcpServer> t = std::make_unique<TcpServer>(port);
    t->Init();
    t->Run();
    return 0;
}